package com.dexgdx.game.actor;

import com.dexgdx.game.constants.RingColor;
import com.dexgdx.game.structure.Region;

public abstract class AbstractActor extends Region {
	
	private static final long serialVersionUID = 4783108189582861810L;

	protected Long actorIndex;
	protected String imagePath;
	protected ActorStatus actorStatus;

	protected Region movingTarget;
	protected Region attackingTarget;
	
	public AbstractActor(String imagePath) {
		super();
		this.imagePath = imagePath;
		this.solidRegion = true;
		this.actorStatus = new ActorStatus();
	}
	
	public abstract RingColor getRingColor();

	public String getImagePath() {
		return imagePath;
	}

	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}
	
	public Long getActorIndex() {
		return actorIndex;
	}
	
	public void setActorIndex(Long actorIndex) {
		if(this.actorIndex == null)
			this.actorIndex = actorIndex;
	}
	
	public void setFromRegion(Region region){
		this.x = region.getX();
		this.y = region.getY();
		this.height = region.getHeight();
		this.width = region.getWidth();
	}

	public ActorStatus getActorStatus() {
		return actorStatus;
	}

	public void setMoving(Region movingTarget){
		actorStatus.setMoving(true);
		this.movingTarget = movingTarget;
	}
	public void unSetMoving(){
		actorStatus.setMoving(false);
		this.movingTarget = null;
	}
	
	public void setAttacking(Region attackingTarget){
		actorStatus.setAttacking(true);
		this.attackingTarget = attackingTarget;
	}
	public void unsetAttacking(){
		actorStatus.setAttacking(false);
		this.attackingTarget = null;
	}

	public Region getMovingTarget() {
		return movingTarget;
	}

	public Region getAttackingTarget() {
		return attackingTarget;
	}
	
}
